1. Field of the Invention
The present invention relates to a synchronization method and an apparatus thereof. More particularly, the present invention relates to a method for synchronizing an audio and a video.
2. Description of Related Art
With existing Internet applications, a user can attend a real-time video conference with people from various locations by using only a computer and a network, which saves the user a lot of time. During a video conference, a sending end transmits a video stream and an audio stream independently to a receiving end via the network due to different characteristics of video signal and audio signal. Because video samples and audio samples are sent separately and independently, a playback time difference between a video sample and its corresponding audio samples may be produced while the machine at the receiving end receives and plays the video and the audio. To eliminate the playback time difference, the synchronization between video samples and corresponding audio samples has to be checked timely and the playback times of video samples and corresponding audio samples have to be adjusted appropriately.
Generally speaking, machines at various ends synchronize the playback times of video samples and audio samples according to the absolute time provided by the network time protocol. However, such method becomes invalid if a machine at one end cannot use the network time protocol. According to another method for audio/video synchronization, the machines at various ends adjust the playback times of video samples and audio samples on the basis of a virtual time axis respectively. However, the algorithm for maintaining such virtual time axis is very complex and may affect the service quality of the video conference. Besides, even though the time axes referred by different machines are synchronized, the clock speeds of the machines may be different to affect the service quality of the video conference. Moreover, the potential problem of clock skew may cause errors to the playback times calculated by various machines.
A method for calculating the number of audio samples corresponding to a video sample by using the sampling frequency of the audio and the playback speed of the video is disclosed in U.S. Pat. No. 5,351,092. If the calculated audio sample number is not an integer, a closest number greater than the audio sample number is used as the audio playback sample number. Too many audio samples may be played at an audio/video synchronization point, thus, the audio has to be paused until the next video sample is played.
A method for obtaining the playback status of an audio and a video by comparing presentation time stamps (PTS) in the audio data and the video data and a system time of the machine is disclosed in U.S. Pat. No. 5,617,502. If the audio or the video is ahead of the other, the audio sample or the video sample is paused playing. If the audio or the video is delayed, those delayed audio sample or video samples having not been played are skipped. This patent is applicable to those platforms based on moving picture experts group (MPEG) system.
According to methods disclosed in U.S. Pat. No. 6,130,987 and U.S. Pat. No. 7,054,544, a reference time is calculated by using the sampling frequency of an audio and audio sample number having been played, and expected video sample number to be played is calculated by using the reference time, wherein the expected video sample number to be played and the video sample number having been played are compared and appropriately adjusted accordingly.
A method for supplying a synchronization information produced while the process of playing audio samples to a video playback apparatus so that the apparatus can determine whether or not the audio and the video are synchronized is disclosed in U.S. Pat. No. 6,452,974, in which the synchronization information may be audio sample number having been played and the time period from the beginning of playing audio samples to present.
According to the method disclosed in U.S. Pat. No. 6,510,279, an audio time stamp is calculated by using sampling frequency of an audio and audio sample number having been played, and the time stamps of the audio and the video are compared at fixed time points, in which the video sample is paused playing if the time stamp of the video is greater than the time stamp of the audio, otherwise those delayed video samples having not been played are skipped.